/**
 * @author ZhiWen Ren
 * @version 1.0
 * @description: LeetCode-70-爬楼梯
 * @date 2025/7/24 15:34
 */
public class Solution70 {
    public int climbStairs(int n) {
        // dp[n] = dp[n-1] + dp[n-2]
        int first = 1, second = 1, ans = 1;
        while (n > 1) {
            ans = first + second;
            first = second;
            second = ans;
            n--;
        }
        return ans;
    }
}
